package uitest
{
	import flash.display.Bitmap;
	import flash.display.Sprite;
	import flash.utils.setTimeout;
	import iscript.uiFramework.components.button.BaseButton;
	import iscript.uiFramework.components.text.Label;
	import iscript.uiFramework.components.toolbar.Toolbar;
	import iscript.uiFramework.components.toolButton.CloseButton;
	import iscript.uiFramework.components.toolButton.FindButton;
	import iscript.uiFramework.components.toolButton.HelpButton;
	import iscript.uiFramework.components.toolButton.MaxButton;
	import iscript.uiFramework.components.toolButton.MinButton;
	import iscript.uiFramework.components.toolButton.RefreshButton;
	import iscript.uiFramework.components.toolButton.SaveButton;
	import iscript.uiFramework.components.toolButton.SettingButton;
	
	public class ToolBarTest extends Sprite
	{
		
		[Embed(source="../../bin/panelBg.png")]
		private var header:Class;
		public function ToolBarTest()
		{
			var toolbar:Toolbar = new Toolbar(400,25);
			toolbar.x = 500;
			toolbar.y = 50; 
			// toolbar.alpha= 0.1
			for (var i:int = 0; i < 5; i++)
			{
				var button:BaseButton = new BaseButton();
				if (i == 0) {
					
					button.HoldDownHandler = function(e:*):void {
						trace(i)
						}
					}
				
				button.text = "File_" + i;
				if (i >1) {
			 		//toolbar.addCmpRight(button);					
					}else {
					//toolbar.addCmpLeft(button);	
					}
			}
			toolbar.border = true;
			toolbar.getBorder().color = 0x99BCE8;
			toolbar.render(this);
			
			
		//	toolbar.background = true;
			
			//toolbar.getBackground().begFill( Bitmap(new header()).bitmapData)
  
			
			var label:Label = new Label();
			    label.text = "Head";
				label.size = 12;
				label.color = 0x0F6484;
				label.bold = true;
				trace(">>>>",label.height)
			 toolbar.addCmpLeft(label);
				
				
				var button2:BaseButton = new BaseButton();
				button2.width = 50;
				
				button2.text = "Save_" + i;
				toolbar.addCmpLeft(button2);
				
				
				
				
				toolbar.addCmpRight(new MinButton());
				toolbar.addCmpRight(new MaxButton());
/*				toolbar.addCmpRight(new FindButton());
				toolbar.addCmpRight(new SettingButton());
				toolbar.addCmpRight(new RefreshButton());
				toolbar.addCmpRight(new SaveButton());
				toolbar.addCmpRight(new HelpButton());*/
				toolbar.addCmpRight(new CloseButton());
				
				setTimeout(function():void {
					//button2.width=200
						toolbar.width = 600;
					},3000)
 
		
		}
	
	}

}